<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text" name="password" id="">
    <br>
    <span id="msg"></span>
    <script>
        // 字符串提供的函数
        // let name = "houdUNnren.com";
        // console.log(name.length);
        // console.log(name.toUpperCase());
        // console.log(name.toLowerCase());
        // let site = "  hdcms  ";
        // console.log(site.length);

        // console.log(site.trim().length);


        // console.log(site.trim().length);
        // let ps = document.querySelector("[name='password']");
        // ps.addEventListener("keyup", function () {
        //     this.value = this.value.trim();
        //     console.log(this.value.trim().length);
        //     let error = "";
        //     let span = document.getElementsByTagName('span');
        //     if (this.value.length < 6) {

        //         error = "密码不能小于6位"
        //         // console.log(span[0].innerHTML = error);
        //     }
        //     span[0].innerHTML = error;
        // })
        let hd = "后盾人";
        console.log(hd.charAt(0));
        //迭代器的写法
        console.log(hd[0]);
        for (let i = 0; i < hd.length; i++) {
            let span = document.createElement("span");

            span.style.fontSize = (i + 1) * 10 + "px";

            span.innerHTML = hd[i];

            document.body.append(span);

        }



    </script>
</body>

</html>